﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Drawing;

namespace HOOMT
{
    class StaticComplexRelationship : OriginalLine
    {
        public StaticComplexRelationship(Point point1, Point point2, OriginalDiagram startDiagram, OriginalDiagram endDiagram)
            : base(point1, point2, startDiagram, endDiagram)
        {
        }

        public StaticComplexRelationship(Point point1, Point point2, string id, OriginalDiagram startDiagram, OriginalDiagram endDiagram)
            : base(point1, point2, id, startDiagram, endDiagram)
        {
        }
        //***********************************************************************************
        public override void Drawing(Graphics g, OriginalModelForm m)
        {
            Pen pen = new Pen(Color.Brown, 1);
            g.DrawLine(pen, GetStartShowPoint(), GetEndShowPoint());
            g.DrawEllipse(pen, new Rectangle((GetStartShowPoint().X + GetEndShowPoint().X) / 2 - 5, (GetEndShowPoint().Y + GetStartShowPoint().Y) / 2 - 5, 10, 10));
            //g.DrawEllipse(pen, new Rectangle((GetStartShowPoint().X + GetEndShowPoint().X) / 2 - 3, (GetEndShowPoint().Y + GetStartShowPoint().Y) / 2 - 3, 6, 6));
        }
        //***********************************************************************************
        public override bool equalTo(OriginalLine line)
        {
            //判断直线反向相等
            if (endPoint == line.StartPoint && startPoint == line.EndPoint)
                return true;
            //判断相等
            return base.equalTo(line);
        }
    }
}

